import { getInformList } from "@/api/inform";
const user = {
    state: {
        token: "", // 用户token
        userInfo: "",
        unreadInform: [], // 用户通知消息
    },
    mutations: {
        setToken: (state: any, self: string) => {
            state.token = self;
        },
        setUserInfo: (state: any, self: any) => {
            state.userInfo = self;
        },
        getUnreadInform: (state: any, teamId: any) => {
            state.unreadInform = [];
            getInformList({
                type: "",
                pageNum: 1,
                pageSize: 100,
                teamId: teamId,
                title: "",
                isRead: 2,
            }).then((res) => {
                state.unreadInform = res.data.total;
            });
        },
    },
    actions: {},
};
export default user;
